package com.briup.day12.bean;

/**
 * @author ThinkBook
 */
public class Dog extends Animal{
    //新增成员：跟父类成员age重名
    public int age = 20;

    public void showAge(int age){
        System.out.println("age:" + age);
        System.out.println("this.age:" + this.age);
        System.out.println("super.age:" + super.age);

    }


    /*
    继承父类成员
        Animal:private String color;  //不能直接访问
        Animal:public int age;  //能直接访问
     */
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void show(){
        //color age name

        //System.out.println(Color);
        //借助继承的public方法，简介访问继承的父类私有成员
        System.out.println(getColor());
        System.out.println("age: " + age);
        System.out.println("name: " + name);

    }
}
